<include file="Base/header" />

<form action="{:U('config')}" method="post" class="form-horizontal js-ajax-forms edit-form" enctype="multipart/form-data">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
        <tr>
            <th width="120">首页分类推荐</th>
            <td>
            	<select name="post[custom_cate_id]" id="">
            		<option value="">请选择类别</option>
            		{:get_cate_select(['1','2','5'],$config[custom_cate_id])}
            	</select>
            	<input type='hidden' name="post[custom_cate_name]" id='custom_cate_name' value="{$config[custom_cate_name]}" />
            </td>
        </tr>
    </table>
	<div class="commonBtnArea">
	    <button class="btn js-ajax-submit"  type='submit'>提交</button>
	    <a href="{:U('index')}" class="btn" >返回</a>
	</div>
</form>

                

<include file="Base/footer" />

</body>

<script type="text/javascript">
validateForm({
    rule:{
		'post[custom_cate_name]' : {required : 1},
		},
    message:{
	'post[custom_cate_name]' : {required : '请选择类别'},
	}
},"{:U('index')}")

$('select').change(function(){
	var catename = $(this).find('option:selected').attr('catename');
	$('#custom_cate_name').val(catename);
	
})
 
    
 </script> 
</html>